<?php
if (!defined('APP_ID')) { die('No direct script access allowed'); }

class Email_Driver_Native {
	private $_parent = null;
	
	public function __construct($parent) {
		$this->_parent = $parent;
	}

	public function send() {
		$result = false;

		$to = $this->_parent->getTo();
		$headers = $this->_parent->getHeaders(false);
		$subject = $this->_parent->getSubject();
		$body = $this->_parent->getBody();

		if (mail($to, $subject, $body, $headers)) {
			$result = true;
		}

		return $result;
	}
}